﻿using STHPMS1.ICore.I_Entity.Info;
using STHPMS1.ICore.I_Entity.Stmpms1;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace STHPMS1.ICore.I_BLL.Bus
{
    public interface IB_RoadwayBill : IBll
    {
        /// <summary>
        /// 得到路线的方向数量(1:未划分方向)
        /// </summary>
        /// <param name="rdid"></param>
        /// <returns></returns>
        int GetDir(string rdid);
        /// <summary>
        /// 根据编号查询路线对象
        /// </summary>
        /// <param name="rdid"></param>
        /// <returns></returns>
        List<T> SearchById<T>(string rdid) where T:class,IB_Roadway;
        /// <summary>
        /// 检测路线是否分指定方向
        /// </summary>
        /// <param name="rdwayid"></param>
        /// <param name="dir"></param>
        /// <returns></returns>
        bool CheckRoadDir(string rdwayid, int dir);
       
        /// <summary>
        /// 计算路线总长度
        /// </summary>
        /// <param name="rdwayid"></param>
        /// <returns></returns>
        double GetLength(string rdwayid);
        void Save<T>(T entity) 
            where T:class ,IB_Roadway;

        void Remove(IB_Roadway entity);

        IEnumerable<T> Get<T>(Expression<Func<T, bool>> predicate, IPagingInfo info)
            where T : class, IB_Roadway;

        /// <summary>
        /// 获取所有路线的ID与名称
        /// </summary>
        /// <returns></returns>
        Dictionary<string, string> Dicts();

        /// <summary>
        /// 获取所有道路信息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        IEnumerable<T> GetAll<T>() where T : class, IB_Roadway;
        /// <summary>
        /// 获取路线的最新养护版本号
        /// </summary>
        /// <param name="increase">是否增加一个版本</param>
        /// <returns></returns>
        double GetNewHistoryVersion(string rdwayid, bool increase = true);

        int GetAdmdiv(string rdwayid);

        Dictionary<int, string> GetADMDIV();

        bool Exists(string rdId);

        /// <summary>
        /// 查询有检测数据的路线
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        IEnumerable<T> SearchRoad<T>()
            where T : class, IB_Roadway;

        bool ExistsMP(string rdId, double bmp, double emp);

        string GetRoadnetName(string rdwayid);
    }
}
